import pygame
import os
pygame.init()
pygame.display.set_mode((640,480),0)
pygame.display.set_caption("试试")
# pygame.event.set_blocked([pygame.KEYDOWN, pygame.KEYUP])
print(pygame.event.get_blocked(pygame.KEYDOWN))
print(pygame.event.get_grab())
while True:
    for e in pygame.event.get():
        print (e.type)
        if e.type==pygame.KEYDOWN:
            print (e.key)